flattenlistmodel: Do proper check
authorBenjamin Otte <otte@redhat.com>
Wed, 15 May 2019 20:18:56 +0000 (22:18 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 15 May 2019 21:39:37 +0000 (23:39 +0200)
If we want the model items to be listmodels, we don't need to do a ==
comparison. We need to do g_type_is_a(). Implementations of listmodels
are obviously fine.

gtk/gtkflattenlistmodel.c

index 614493e28f9148b2657bed22bd2b8f9eabc24fe2..e33a47a30b7c4e0a3edb84aed80fce8b56abfdd8 100644 (file)
@@ -486,7 +486,7 @@ gtk_flatten_list_model_set_model (GtkFlattenListModel *self,
   g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));
   if (model)
     {
-      g_return_if_fail (g_list_model_get_item_type (model) == G_TYPE_LIST_MODEL);
+      g_return_if_fail (g_type_is_a (g_list_model_get_item_type (model), G_TYPE_LIST_MODEL));
     }
 
   if (self->model == model)